package com.ddd.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

@Slf4j
@Controller
public class FormTestController {

    @GetMapping("form_layouts.html")
    public String form_layouts()
    {
        return "form_layouts";
    }

    @PostMapping("upload")
    public String upload(
         @RequestParam("email") String email,
         @RequestParam("password")    String password,
         @RequestPart("file") MultipartFile file,
         @RequestPart("file1")   MultipartFile[] file1
    ){

        log.info(""+file.getSize());
        log.info(file1.length+"");

        return "main";
    }
}
